package util

import (
	"os"
	"os/signal"
	"syscall"
)

//SystemQuit ..系统接收到信号退出
func SystemQuit(call func()){
	signalChan := make(chan os.Signal, 1)
	signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM)
	go func(){
		<-signalChan
		call()
		os.Exit(0)
	}()
}